GBML manual / Constants

BGLOOK_SWAY

A slow sway: the picture bends one way and then the other as you go down the screen, like a dream.

Syntax

BGLOOK_SWAY: constant

<!-- GENERATED by tools/gbabel_looks.py from its LOOKS registry. Never edit this page: change the registry and re-run it. -->

Description

Names the slow sway, for background_look. The background is moved sideways in one wide, lazy curve 128 rows long, so the picture bends to one side and then the other. It is much wider than BGLOOK_WAVE.

strength is how far it sways, each way: 4, 8 or 16 pixels. Use a slow speed such as 0.1.

A real capture, four pictures of the same pine forest at dusk - straight, then with BGLOOK_SWAY at strength 1, strength 2 and strength 3 (the trees bend further and further to one side as you go down the screen, then back the other way) - the bend held in the same place each timeA real capture, four pictures of the same pine forest at dusk - straight, then with BGLOOK_SWAY at strength 1, strength 2 and strength 3 (the trees bend further and further to one side as you go down the screen, then back the other way) - the bend held in the same place each time
A real capture, four pictures of the same pine forest at dusk - straight, then with BGLOOK_SWAY at strength 1, strength 2 and strength 3 (the trees bend further and further to one side as you go down the screen, then back the other way) - the bend held in the same place each time

The same picture four times: straight, then strength 1, 2 and 3 from left to right, each one standing still where the pattern had got to. Real pictures from a Game Boy Advance ROM.

speed is how many rows the pattern travels down the screen every frame. 0 holds it still, a negative number sends it up, 0.25 is slow and 1 is quick. The pattern belongs to the rows of the screen, not to the picture.

A real capture, 16 frames played in a loop - the whole pine forest sways slowly, the trees bending one way and then the other as the bend travels down the screenA real capture, 16 frames played in a loop - the whole pine forest sways slowly, the trees bending one way and then the other as the bend travels down the screen
A real capture, 16 frames played in a loop - the whole pine forest sways slowly, the trees bending one way and then the other as the bend travels down the screen

The pattern moving, sped up: sixteen real pictures four frames apart, played 70 milliseconds each, at strength 3. It is a whole turn of the pattern, so the loop has no seam. This picture is an animated PNG; a viewer that cannot animate shows its first frame.

Example

backdrop = background_create(0, 0, ts_doc_dungeon);
background_look(backdrop, BGLOOK_SWAY, 2, 0.5);

A background that sways like a dream. Turn it off with background_look(my_background, BGLOOK_NONE, 0, 0) before you destroy the background.

See also: background_lookBGLOOK_NONEBGLOOK_WAVE